// pv (page view) 跟踪跳转页面
export function createHistoryEvent <T extends keyof History> (type: T) {
    const originFn = history[type]

    return function (this: any) {
        const res = originFn.apply(this, arguments)

        // new Event创建自定义事件
        const ev = new Event(type)
        // dispatchEvent派发事件
        window.dispatchEvent(ev)

        return res
    }
}